# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=krusader
pkgver=2.8.1
pkgrel=0
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://apps.kde.org/krusader"
pkgdesc="Advanced twin panel (commander style) file manager"
license="GPL-2.0-or-later and GFDL-1.1-or-later"
makedepends="
	extra-cmake-modules
	karchive5-dev
	kbookmarks5-dev
	kcodecs5-dev
	kcompletion5-dev
	kconfig5-dev
	kcoreaddons5-dev
	kdoctools5-dev
	kguiaddons5-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	kitemviews5-dev
	knotifications5-dev
	kparts5-dev
	ktextwidgets5-dev
	kwallet5-dev
	kwidgetsaddons5-dev
	kwindowsystem5-dev
	kxmlgui5-dev
	qt5-qtbase-dev
	samurai
	solid5-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/utilities/krusader.git"
#source="https://download.kde.org/stable/krusader/$pkgver/krusader-$pkgver.tar.xz"
source="$pkgname-$pkgver.tar.gz::https://invent.kde.org/utilities/krusader/-/archive/v$pkgver/krusader-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
ba69dca09303f893d6e39815ac1b8ac16e512a50714c31820da62ad3ea5551ff674fd51659c3ba4268115ddd3b94cf700ad4d6c0094ae31122ec9c96ba752305  krusader-2.8.1.tar.gz
"
